
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/global.css">
    <link rel="stylesheet" href="../../static/css/table.css">
    <script src="../../static/common/axios.min.js"></script>
    <script src="../../static/common/vue.min.js"></script>
    <script src="../../static/common/layui/layui.js"></script>
</head>
<div style="margin: 15px;" id="Vue" v-cloak>
    <div v-show="show">
        <blockquote class="layui-elem-quote">
            <a href="#" class="layui-btn layui-btn-small" onclick="location='/admin/ManagSendMessage'">
                <i class="layui-icon">&#xe608;</i> 发布新通知
            </a>
            <a href="#" class="layui-btn layui-btn-small" onclick="location='/admin/test'">
                <i class="layui-icon">&#xe608;</i>test
            </a>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>通知信息</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <th>标题</th>
                        <th>发布日期</th>
                        <th>来源</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>

        </div>
    </div>

    <div v-show="!show">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">通知标题</label>
                <div class="layui-input-inline" style="width:300px;">
                    <input type="text" name="title"  class="layui-input"  disabled="disabled" v-model="notice.title">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">通知内容</label>
                <div class="layui-input-block">
                    <div class="layui-textarea"  style="width:803px; height:400px" disabled="disabled" id="hello"></div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">来源</label>
                <div class="layui-input-inline">
                    <input type="text" name="source"  class="layui-input"  disabled="disabled" v-model="notice.source">
                </div>
                <label class="layui-form-label">发布人</label>
                <div class="layui-input-inline">
                    <input type="text" name="title"  class="layui-input"  disabled="disabled" v-model="composerName">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">发布日期</label>
                <div class="layui-input-inline" >
                    <input type="text" name="publishdate"  class="layui-input"  disabled="disabled" v-model="notice.publishdate">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" class="layui-btn" @click="reload" value="返回">
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/html" id="tpl">
    {{# var n=d.data.length}}
    {{# layui.each(d.data,function(index, item){ }}
    {{# var item1=d.data[n-1];n--}}
    <tr>
        <td>{{ item1.title || "-" }}</td>
        <td>{{item1.publishdate|| "-"}}</td>
        <td>{{ item1.source || "-"}}</td>
        <td><a href="javascript:;" target="_self" data-id="{{item.id}}" data-opt="more"
               class="layui-btn layui-btn-normal layui-btn-mini" style="background-color: #009688;">详情</a>
            <a href="javascript:;" data-opt="delete" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
    </tr>
    {{# }); }}
</script>
<script src="../../static/js/admin/messageMain.js"></script>
<script>
    var publisherid = ${sessionScope.currentUser.getId()};
    var adminDetail = {};
    axios.get('/magfacultyinfo/findOne/'+publisherid)
        .then(function (response) {
//            console.log(response.data);
            adminDetail = response.data.data;
            console.log(adminDetail);
        })
        .catch(function (msg) {
            console.log(msg);
        })
</script>

</body>
</html>
